/*** 
 * @_______________#########_______________________ 
 * @______________############_____________________ 
 * @______________#############____________________ 
 * @_____________##__###########___________________ 
 * @____________###__######_#####__________________ 
 * @____________###_#######___####_________________ 
 * @___________###__##########_####________________ 
 * @__________####__###########_####_______________ 
 * @________#####___###########__#####_____________ 
 * @_______######___###_########___#####___________ 
 * @_______#####___###___########___######_________ 
 * @______######___###__###########___######_______ 
 * @_____######___####_##############__######______ 
 * @____#######__#####################_#######_____ 
 * @____#######__##############################____ 
 * @___#######__######_#################_#######___ 
 * @___#######__######_######_#########___######___ 
 * @___#######____##__######___######_____######___ 
 * @___#######________######____#####_____#####____ 
 * @____######________#####_____#####_____####_____ 
 * @_____#####________####______#####_____###______ 
 * @______#####______;###________###______#________ 
 * @________##_______####________####______________ 
 * @
 * @Author: ipk518 18163976442@163.com
 * @Date: 2024-09-20 15:21:02
 * @LastEditors: ipk518 121206530@qq.com
 * @LastEditTime: 2025-06-09 09:07:06
 * @FilePath: /etws-sxk2307/inc/para-pz.h
 * @Description: 
 * @************佛祖保佑************
 * @Copyright (c) 2024 by etws@quyujiang, All Rights Reserved. 
 */
#ifndef _PZ_H_
#define _PZ_H_

#include <stdio.h>
#include <stdint.h>

#pragma pack(push,1)

typedef union
{
	uint16_t val;
	struct
	{
		uint16_t work_mode:2;//工作模式
		uint16_t pol_mode:2;//极化模式
		uint16_t ADRF5044_V1_X:3;
		uint16_t ADRF5044_V2_X:3;
		uint16_t hm232_8:2;
		uint16_t hm232_9:2;
		uint16_t reserver:2;
	}bit;
}pz_bram_data1_t;

typedef union
{
	uint16_t val;
	struct
	{
		uint16_t RFSA3714_H:7;
		uint16_t reserver:1;
		uint16_t RFSA3714_V:7;
		uint16_t reserver1:1;
	}bit;
}pz_bram_data2_t;

typedef union
{
	uint16_t val;
	struct
	{
		uint16_t HMC424_H:6;
		uint16_t reserver:2;
		uint16_t HMC424_V:6;
		uint16_t reserver1:2;
	}bit;
}pz_bram_data3_t;

typedef union
{
	uint16_t val;
	struct
	{
		uint16_t SXK_RFSA3714_H:7;
		uint16_t reserver:1;
		uint16_t SXK_RFSA3714_V:7;
		uint16_t reserver1:1;
	}bit;
}pz_bram_data4_t;


typedef struct{
	uint16_t AD7616_CHA[8];
	uint16_t AD7616_CHB[8];

	uint16_t DATA0;//脉冲宽度
	pz_bram_data1_t DATA1;
	pz_bram_data2_t DATA2;
	pz_bram_data3_t DATA3;
	pz_bram_data4_t DATA4;
	uint16_t DATA5;//SXK-DAC强度
	uint16_t DATA6;//PWM检测错误计数器
}pz_pl_bram_t;

typedef struct{
	uint32_t Project_code;                 //项目代号
	uint32_t Components;                   //组件
	uint32_t Compilation_platform;         //编译平台
	uint32_t Compilation_Platform_UUID1;    //编译平台 UUID
	uint32_t Compilation_Platform_UUID2;    //编译平台 UUID
	uint32_t Compilation_Platform_UUID3;    //编译平台 UUID
	uint32_t Compilation_Platform_UUID4;    //编译平台 UUID
	uint32_t Compilation_date;             //编译日期
	uint32_t Compilation_time;             //编译时间
	uint32_t Project_version_number;       //工程版本号
	uint32_t Engineering_sub_version_number;       //工程子版本号
	uint32_t Vivado_version;                       //vivado版本
	uint32_t Vivado_sub_version;                   //vivado子版本
}pz_pl_version_t;

typedef struct{
	uint8_t working_mode;	//	单板测试工作模式设置
	uint8_t polarization_direction;	//	极化方向设置
	uint8_t RFSA3714_H;
	uint8_t RFSA3714_V;
	uint8_t HMC424_H;
	uint8_t HMC424_V;
	uint8_t time_calib;//单板测试时序校准开关
	uint16_t pulse_width;//单板测试脉宽
	uint8_t noise;//单板测试噪声标志位
	uint8_t drakroom;
	uint8_t send_delay;
	uint8_t sxk_rfsa3714_h;
	uint8_t sxk_rfsa3714_v;
	uint16_t sxk_dac;
}pz_single_board_t;

typedef struct{
    uint16_t m_major;
    uint16_t m_minor;
    uint16_t m_patch;
    uint16_t m_year;
    uint16_t m_month;
    uint16_t m_data;
}pz_ps_version_t;

typedef struct{
	pz_ps_version_t version;
	float cpu_temperature;
}pz_ps_systempara_t;

typedef struct{
	pz_pl_bram_t bram; //只读
    pz_pl_version_t version;//只读
    pz_single_board_t single_board;//可读可写 注意线程冲突
}pz_pl_systempara_t;

typedef struct{
    pz_ps_systempara_t ps;
    pz_pl_systempara_t pl;
}pz;

#pragma pack(pop)

#endif